package com.jhgk.jhcee.expert.controller;

import com.github.pagehelper.PageInfo;
import com.jhgk.jhcee.auth.model.MajorRecruit;
import com.jhgk.jhcee.common.resultful.BasisResultful;
import com.jhgk.jhcee.common.resultful.PageResultful;
import com.jhgk.jhcee.expert.domain.model.MajorRecruitMode;
import com.jhgk.jhcee.expert.service.MajorRecruitService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author: xiezhongping
 * @description:
 * @date: 2021/8/10 9:41.
 */
@RestController
@RequestMapping("/MajorRecruit")
@Api(value = "专业招生计划",tags = {"专业招生计划"})
public class MajorRecruitController {

    @Resource(name = "MajorRecruitServiceImpl")
    MajorRecruitService majorRecruitService;

    @PostMapping("/searchAllPage")
    @ApiOperation("分页查询专业招生计划")
    public PageResultful<PageInfo<MajorRecruit>> search(@RequestBody @Validated MajorRecruitMode majorRecruitMode) {
        return majorRecruitService.search(majorRecruitMode);
    }

    @GetMapping("/searchAllSize")
    @ApiOperation("查询专业招生计划记录数")
    public BasisResultful<Object> searchAllSize(@RequestParam("provinceUuid")String provinceUuid,@RequestParam("year")Integer year) {
        return majorRecruitService.searchAllSize(provinceUuid,year);
    }


}
